﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using WpfSnqkGasAnalysis.Model;

namespace WpfSnqkGasAnalysis
{
    /// <summary>
    /// 特殊报告打印显示数字，数字为0，显示为/
    /// </summary>
    /// 创建时间：2023-1-13 11:22:41。作者：王浩力
    internal class TeshuNumConvert : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            //if (value == null || (value.ToMyDecimal() == 0 && parameter == null))
            //{
            //    return "/";
            //}
            if (value == null)
            {
                return "/";
            }

            return value;
            //return value.ToMyDecimal().ToString("f3");
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
